back to same page after changing locale

111

@php
    $thisUrl = url()->current().'/';
    if (app()->getlocale() == 'en') {
        $newUrl  = str_replace('/en/', '/it/', $thisUrl);
    }else{
        $newUrl  = str_replace('/it/', '/en/', $thisUrl);
    }
 @endphp

Comments

Submit
0 Comments